﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Details.aspx.vb" Inherits="LondonItalianRestaurants.Details" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="Styles/Restaurant.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <h1>Restaurant Details</h1><asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [ID], [RestaurantName], [RestaurantAddress], [PostCode], [PhoneNumber], [Website], [Restaurantmenu], [AveragePrice], [RestaurantPicture2], [MichelinStars] FROM [Restaurants] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource2" 
        ForeColor="Black" Height="50px" CssClass="det" BackColor="White" 
        GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <CommandRowStyle BackColor="White" Font-Bold="True" />
        <EditRowStyle BackColor="White" />
        <FieldHeaderStyle BackColor="#FFCC66" Font-Bold="True" />
        <Fields>
            <asp:BoundField DataField="RestaurantName" HeaderText="RestaurantName" 
                SortExpression="RestaurantName" />
            <asp:BoundField DataField="RestaurantAddress" HeaderText="RestaurantAddress" 
                SortExpression="RestaurantAddress" />
            <asp:BoundField DataField="PhoneNumber" HeaderText="PhoneNumber" 
                SortExpression="PhoneNumber" />
            <asp:BoundField DataField="AveragePrice" HeaderText="AveragePrice" 
                SortExpression="AveragePrice" />
            <asp:HyperLinkField DataNavigateUrlFields="website" 
                DataNavigateUrlFormatString="{0}" DataTextField="RestaurantName" 
                HeaderText="Website" SortExpression="Website" />
            <asp:HyperLinkField DataNavigateUrlFields="RestaurantMenu" 
                DataNavigateUrlFormatString="{0}" DataTextField="Restaurantmenu" 
                HeaderText="Menu" SortExpression="Menu" />
            <asp:HyperLinkField DataNavigateUrlFields="Postcode" 
                DataNavigateUrlFormatString="http://google.co.uk/maps?q={0}" 
                DataTextField="PostCode" HeaderText="Map" SortExpression="Map" />
            <asp:TemplateField HeaderText="MichelinStars" SortExpression="MichelinStars">
            <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MichelinStars") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                    <b> 

                        <asp:Label ID="Label1" runat="server" ForeColor="blue" Font-Size="X-Large"  Text='<%# ShowStars(Eval("MichelinStars")) %>'></asp:Label></b>
                    </ItemTemplate>
                </asp:TemplateField>
            
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="ReviewList.aspx?ID={0}" HeaderText="Rate/Like" 
                SortExpression="Rate &amp; Like" Text="Rate &amp; Like" />
            <asp:ImageField DataAlternateTextField="RestaurantPicture2" 
                DataImageUrlField="RestaurantPicture2" HeaderText="Image">
                <ControlStyle ForeColor="#66FF33" Height="500px" Width="500px" />
            </asp:ImageField>
        </Fields>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
    </asp:DetailsView>
    <p>
        <div id="Layer1" style="position:relative;width:916px; height:60px;
 overflow:scroll; top: 0px; left: 0px;">
            <asp:CheckBoxList ID="cb_tags" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="TagName" DataValueField="ID" 
            RepeatDirection="Horizontal" Height="30px" style="width:auto" 
                BorderColor="White" CssClass="ckbox">
        </asp:CheckBoxList></div>
        <br />
        <asp:Button ID="btn_addTagsToDB" runat="server" Text="Tag Restaurant" />
        
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        
        Add New tag<asp:TextBox ID="tb_NewTag" runat="server"></asp:TextBox>
        <asp:Button ID="btn_NewTag"
        runat="server" Text= "Add Tag" />

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [TagName] FROM [Tags]"></asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
    </p>
</asp:Content>
